<template>
	<view>
		<Pengpai-FadeInOut
			:duration="2000"
			:wait="1000"
			:top="200"
			:left="10"
			:radius="40"
			:loop="true"
			:info="item"
			v-for="(item, index) in list"
			:key="index"
		></Pengpai-FadeInOut>
		
	</view>
</template>

<script>
	import PengpaiFadeInOut from './Pengpai-FadeInOut.vue'
export default {
	components:{
		PengpaiFadeInOut
	},
	created(){
		setInterval(()=>{
			this.add()
		},1000)
	},
	data() {
		return {
			list: [],
			//演示数据
			demo_data: [
				{
					title: '上海贺**购买了该商品，5分钟前',
					img: 'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83er0aq5WuQhWxXcQoQbSnSPywUheQrot5biaFxV47nF2OB0aegkH12q2A6VkGUBDfUVqiaqgzVCJJicDg/132'
				},
				{
					title: '北京市汪**购买了该商品，5分钟前',
					img: 'https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIOeUhleCNwcOoTtk9Y1zwmpw76FsmAr1bYcKia2AVPiapbtl34jac7SQgjMaibKDJCqjYaHwvmUh3IQ/132'
				},
				{
					title: '浙江省郑**购买了该商品，5分钟前',
					img: 'https://wx.qlogo.cn/mmopen/vi_32/OaXz0rjMsrHkZlfxeEqRhhUCKyaXyVSbCQZWFUeZQuUetKhbQRZiclqNQhFfv3yiclOzTl1FgZdjDpwAFG5gDhBg/132'
				},
			]
		};
	},
	onLoad() {},
	methods: {
		add() {
			//随机获取演示数据
			let randomItem = this.demo_data[Math.floor(Math.random() * this.demo_data.length)];

			//追加一条数据
			this.list = this.list.concat(randomItem);
		}
	}
};
</script>

<style></style>
